home *** CD-ROM | disk | FTP | other *** search
- #ifndef __MENUHANDLER__
- #define __MENUHANDLER__
- /******************************************************************************\
- *
- * Apple Macintosh Developer Technical Support
- *
- * Main program file for the ColorReset application
- *
- * Program: ColorReset
- * File: MenuHandler.h
- *
- * by: Forrest Tanaka
- *
- * Copyright © 1988-1992 Apple Computer, Inc.
- * All rights reserved.
- *
- \******************************************************************************/
-
-
- /******************************************************************************\
- * Constants
- \******************************************************************************/
-
- #define mApple 128 /* Menu ID and resource ID of Apple menu */
- #define iAbout 1 /* Menu item number of About SevenPaint item */
-
- #define mFile 129 /* Menu ID and resource ID of File menu */
- #define iOpen 1 /* Menu item number of Open… item */
- #define iClose 3 /* Menu item number of Close item */
- #define iSaveAs 4 /* Menu item number of Save As… item */
- #define iQuit 6 /* Menu item number of Quit item */
-
- #define mEdit 130 /* Menu ID and resource ID of Edit menu */
- #define iUndo 1 /* Menu item number of Undo item */
- #define iCut 3 /* Menu item number of Cut item */
- #define iCopy 4 /* Menu item number of Copy item */
- #define iPaste 5 /* Menu item number of Paste item */
- #define iClear 6 /* Menu item number of Undo item */
-
- #define mDisplay 131 /* Menu ID and resource ID of Display menu */
- #define iDithering 1 /* Menu item number of Dithering item */
- #define iForeground 2 /* Menu item number of Foreground Color… item */
- #define iBackgreound 3 /* Menu item number of Background Color… item */
-
- #define mLastMenu mDisplay /* Menu ID of the last menu in the menu bar */
-
-
- /******************************************************************************\
- * StartMenus - Do additional initialization of the menus
- *
- * This routine is called just after calling the Utilities sample code routine,
- * StandardMenuSetup. This application needs to do just a little bit of
- * additional initialization for menus. See MenuHandler.c for details.
- *
- * If there isn’t enough memory to load the menus, then memFullErr is returned.
- * If desired menu resources couldn’t be found, then resNotFound is returned. If
- * any other error occurs, then dsSysErr is returned.
- \******************************************************************************/
-
- OSErr StartMenus(void);
-
-
- /******************************************************************************\
- * DoMenuChoice - Dispatch to the appropriate routine for a menu choice
- *
- * When it’s determined that a menu item was chosen, this routine is called to
- * dispatch to the appropriate routine for the chosen menu item. The menu item
- * and menu number returned by MenuSelect and MenuKey is passed in the menuChoice
- * parameter.
- \******************************************************************************/
-
- void DoMenuChoice(
- long menuChoice);
-
-
- /******************************************************************************\
- * FixMenus - Fix menus so that proper items are enabled and marked
- *
- * FixMenus is called to assure that menu items are disable, enabled, marked, and
- * unmarked appropriately. It’s called at the end of every iteration of the main
- * event loop.
- \******************************************************************************/
-
- void FixMenus(void);
-
-
- /******************************************************************************\
- * DisableAllMenus - Disable all menus except for the Help and Keyboard menus
- *
- * This routine disables all menus for a modal dialog box. To restore all the
- * menu’s enable states back to the way they were, call RestoreAllMenus.
- * FixMenus should not be called between the calls to DisableAllMenus and
- * ReenableAllMenus.
- \******************************************************************************/
-
- void DisableAllMenus(void);
-
-
- /******************************************************************************\
- * ReenableAllMenus - Reenable menus that were enabled at DisableAllMenus
- *
- * ReenableAllMenus reenables all menus that were disabled with DisableAllMenus.
- * This routine should be called after a modal dialog box goes away.
- \******************************************************************************/
-
- void ReenableAllMenus(void);
-
-
- #endif
-